﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.LIB;
using YJKRevitCode.FormUtility;

namespace YJKOpeningDetail
{
	public partial class OpeningViewDataSetForm : System.Windows.Forms.Form
	{
		public static bool BChkBeamDimTop
		{
			get
			{
				return OpeningViewDataSetForm.m_bChkBeamDimTop;
			}
			set
			{
				OpeningViewDataSetForm.m_bChkBeamDimTop = value;
			}
		}

		public static bool BChkBeamDimBottom
		{
			get
			{
				return OpeningViewDataSetForm.m_bChkBeamDimBottom;
			}
			set
			{
				OpeningViewDataSetForm.m_bChkBeamDimBottom = value;
			}
		}

		public static bool BRadSelGrid
		{
			get
			{
				return OpeningViewDataSetForm.m_bRadSelGrid;
			}
			set
			{
				OpeningViewDataSetForm.m_bRadSelGrid = value;
			}
		}

		public static bool BRadSelWall
		{
			get
			{
				return OpeningViewDataSetForm.m_bRadSelGrid;
			}
			set
			{
				OpeningViewDataSetForm.m_bRadSelWall = value;
			}
		}

		public OpeningViewDataSetForm()
		{
			this.InitializeComponent();
			this.InitializeForm();
			this.m_useControlInfoManger = new ControlInfoManager(this, new List<KeyValuePair<Control, bool>>
			{
				new KeyValuePair<Control, bool>(this.radSelTopLevel, false),
				new KeyValuePair<Control, bool>(this.radSelBottomLevel, false),
				new KeyValuePair<Control, bool>(this.radSelGrid, false),
				new KeyValuePair<Control, bool>(this.radSelWall, false)
			}, null, null);
		}

		private void InitializeForm()
		{
			this.radSelGrid.Checked = true;
			this.radSelBottomLevel.Checked = true;
			this.radSelTopLevel.Checked = false;
		}

		private void btnOK_Click(object sender, EventArgs e)
		{
			OpeningViewDataSetForm.m_bRadSelGrid = this.radSelGrid.Checked;
			OpeningViewDataSetForm.m_bChkBeamDimTop = this.radSelTopLevel.Checked;
			OpeningViewDataSetForm.m_bChkBeamDimBottom = this.radSelBottomLevel.Checked;
			OpeningViewDataSetForm.m_bChkBeamDimTop = this.radSelTopLevel.Checked;
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			base.Close();
		}

		private void OpeningViewDataSetForm_Load(object sender, EventArgs e)
		{
			//base.Icon = Resource.YArchitechIcon;
			if (this.m_useControlInfoManger != null)
			{
				this.m_useControlInfoManger.SetControlInfoToForm();
			}
		}

		private void OpeningViewDataSetForm_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (this.m_useControlInfoManger != null)
			{
				this.m_useControlInfoManger.GetControlInfoToXml();
			}
		}

		private static bool m_bChkBeamDimTop = true;

		private static bool m_bChkBeamDimBottom = false;

		private static bool m_bRadSelGrid = true;

		private static bool m_bRadSelWall = false;

		private ControlInfoManager m_useControlInfoManger;
	}
}
